import request from '../utils/request'
import { AddressType } from '../types/zzy_types/user'

//菜单
export const orderDel = () => {
  return request.get('/classes/Vueremai')
}

export const drinkDel = () => {
  return request.get('/classes/Vuedrink')
}

export const selectedDel = () => {
  return request.get('/classes/Vuejingxuan')
}

export const stapleDel = () => {
  return request.get('/classes/Vuedishes')
}

//地址
export const addressAdd = (addressObj: AddressType) => {
  return request.post('/classes/Vueaddress', addressObj)
}

export const addressGet = () => {
  return request.get('/classes/Vueaddress')
}
export const addressPut = (objectId: string, addressObj: AddressType) => {
  return request.put(`/classes/Vueaddress/${objectId}`, addressObj)
}
export const addressDel = (objectId: string) => {
  return request.delete(`/classes/Vueaddress/${objectId}`)
}

//主页图片
export const getPic = () => {
  return request.get('/classes/Vuepic')
}

//存菜单信息
interface obj {
  img: string,
  objectId: string,
  price: string,
  name: string,
  num: string,
  id: string,
  n: Number,
  updateAt: string
}
export const paySuc = (obj: any) => {
  return request.post('/classes/VuepaySuc', obj)
}
export const payFail = (obj: any) => {
  return request.post('/classes/VuepayFail', obj)
}
export const payAll = (obj: any) => {
  return request.post('/classes/VuepayAll', obj)
}

export const getSuc = () => {
  return request.get('/classes/VuepaySuc')
}
export const getFail = () => {
  return request.get('/classes/VuepayFail')
}
export const getAll = () => {
  return request.get('/classes/VuepayAll')
}